home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / swanson / mainmenu.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-01-06  |  7.5 KB  |  262 lines

  1. VERSION 2.00
  2. Begin Form MainMenu 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00C0C0C0&
  5.    Caption         =   "VBits - Optimizing Visual Basic Code"
  6.    ClientHeight    =   4665
  7.    ClientLeft      =   1305
  8.    ClientTop       =   1815
  9.    ClientWidth     =   4395
  10.    ClipControls    =   0   'False
  11.    Height          =   5355
  12.    Icon            =   MAINMENU.FRX:0000
  13.    Left            =   1245
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    ScaleHeight     =   4665
  17.    ScaleWidth      =   4395
  18.    Top             =   1185
  19.    Width           =   4515
  20.    Begin CheckBox chkSplash 
  21.       BackColor       =   &H00C0C0C0&
  22.       Caption         =   "Splash Screen"
  23.       Height          =   285
  24.       Left            =   2490
  25.       TabIndex        =   11
  26.       Top             =   2895
  27.       Width           =   1545
  28.    End
  29.    Begin Frame Frame1 
  30.       BackColor       =   &H00C0C0C0&
  31.       Caption         =   "Examples"
  32.       ClipControls    =   0   'False
  33.       Height          =   4440
  34.       Left            =   120
  35.       TabIndex        =   9
  36.       Top             =   105
  37.       Width           =   4140
  38.       Begin OptionButton optSplash 
  39.          BackColor       =   &H00C0C0C0&
  40.          Caption         =   "Application Load"
  41.          Height          =   255
  42.          Left            =   405
  43.          TabIndex        =   10
  44.          Top             =   2790
  45.          Width           =   1845
  46.       End
  47.       Begin CommandButton cmdShow 
  48.          Caption         =   "E&xit"
  49.          Height          =   372
  50.          Index           =   1
  51.          Left            =   2385
  52.          TabIndex        =   8
  53.          Top             =   3915
  54.          Width           =   1332
  55.       End
  56.       Begin OptionButton optOLE 
  57.          BackColor       =   &H00C0C0C0&
  58.          Caption         =   "OLE Automation"
  59.          Height          =   250
  60.          Left            =   400
  61.          TabIndex        =   6
  62.          Top             =   2450
  63.          Width           =   2000
  64.       End
  65.       Begin OptionButton optImages 
  66.          BackColor       =   &H00C0C0C0&
  67.          Caption         =   "Images v. Pictures"
  68.          Height          =   250
  69.          Left            =   400
  70.          TabIndex        =   5
  71.          Top             =   2100
  72.          Width           =   2000
  73.       End
  74.       Begin OptionButton optAlgorithms 
  75.          BackColor       =   &H00C0C0C0&
  76.          Caption         =   "Algorithms"
  77.          Height          =   250
  78.          Left            =   400
  79.          TabIndex        =   1
  80.          Top             =   700
  81.          Width           =   2000
  82.       End
  83.       Begin OptionButton optStrings 
  84.          BackColor       =   &H00C0C0C0&
  85.          Caption         =   "Strings && Files"
  86.          Height          =   250
  87.          Left            =   400
  88.          TabIndex        =   4
  89.          Top             =   1750
  90.          Width           =   2000
  91.       End
  92.       Begin CommandButton cmdShow 
  93.          Caption         =   "&Show"
  94.          Default         =   -1  'True
  95.          Height          =   372
  96.          Index           =   0
  97.          Left            =   375
  98.          TabIndex        =   7
  99.          Top             =   3915
  100.          Width           =   1332
  101.       End
  102.       Begin OptionButton optDataXess 
  103.          BackColor       =   &H00C0C0C0&
  104.          Caption         =   "Data Access"
  105.          Height          =   250
  106.          Left            =   400
  107.          TabIndex        =   3
  108.          Top             =   1400
  109.          Width           =   2000
  110.       End
  111.       Begin OptionButton optGraphics 
  112.          BackColor       =   &H00C0C0C0&
  113.          Caption         =   "Graphics"
  114.          Height          =   250
  115.          Left            =   400
  116.          TabIndex        =   2
  117.          Top             =   1050
  118.          Width           =   2000
  119.       End
  120.       Begin OptionButton optVariables 
  121.          BackColor       =   &H00C0C0C0&
  122.          Caption         =   "Variables"
  123.          Height          =   250
  124.          Left            =   400
  125.          TabIndex        =   0
  126.          Top             =   350
  127.          Value           =   -1  'True
  128.          Width           =   2000
  129.       End
  130.       Begin Image Image1 
  131.          Height          =   480
  132.          Left            =   3570
  133.          Picture         =   MAINMENU.FRX:0302
  134.          Top             =   165
  135.          Width           =   480
  136.       End
  137.    End
  138.    Begin Menu mnu_File 
  139.       Caption         =   "&File"
  140.       Begin Menu mnu_FileExit 
  141.          Caption         =   "E&xit"
  142.       End
  143.    End
  144.    Begin Menu mnu_Help 
  145.       Caption         =   "&Help"
  146.       Begin Menu mnu_HelpAbout 
  147.          Caption         =   "&About..."
  148.       End
  149.    End
  150. Sub cmdShow_Click (Index As Integer)
  151.     Select Case Index
  152.       Case 0  ' Show
  153.         If optVariables Then
  154.           Variables.Show
  155.         ElseIf optDataXess Then
  156.           Dataxess.Show
  157.         ElseIf optStrings Then
  158.           Strings.Show
  159.         ElseIf optAlgorithms Then
  160.           Algorithms.Show
  161.         ElseIf optImages Then
  162.           frmPictures.Show
  163.         ElseIf optOLE Then
  164.           frmOLE.Show
  165.         ElseIf optGraphics Then
  166.           Graphics.Show
  167.         ElseIf optSplash Then
  168.           If chkSplash.Value = CHECKED Then
  169.             ShowSplash
  170.           
  171.           Else
  172.             NoSplash
  173.           End If
  174.             
  175.         End If
  176.     Case 1 ' Exit
  177.       Unload Me
  178.   End Select
  179. End Sub
  180. Sub Form_Load ()
  181.     Me.Left = (Screen.Width - Me.Width) / 2
  182.     Me.Top = (Screen.Height - Me.Height) / 2
  183. End Sub
  184. Sub mnu_FileExit_Click ()
  185.     Unload Me
  186. End Sub
  187. Sub mnu_HelpAbout_Click ()
  188.     frmAbout.Show
  189. End Sub
  190. Sub NoSplash ()
  191.             
  192.   ' Now load a bunch of forms.
  193.   Dim foo1 As New frmImages
  194.   foo1.Caption = "Foo1"
  195.   foo1.Left = 0
  196.   foo1.Top = 0
  197.           
  198.   Dim foo2 As New frmImages
  199.   foo2.Caption = "Foo2"
  200.   foo2.Left = 200
  201.   foo2.Top = 100
  202.           
  203.   Dim foo3 As New frmImages
  204.   foo3.Caption = "Foo3"
  205.   foo3.Left = 300
  206.   foo3.Top = 150
  207.           
  208.   Dim foo4 As New frmImages
  209.   foo4.Caption = "Foo4"
  210.   foo4.Left = 400
  211.   foo4.Top = 200
  212. End Sub
  213. Sub ShowSplash ()
  214.   On Error GoTo SplashLoadErr
  215.   iStatusBarWidth = 4575
  216.             
  217.   Screen.MousePointer = HOURGLASS
  218.   Load Splash
  219.   Splash.Show
  220.   ' Set the splash screen to stay on top.
  221.   success% = SetWindowPos(Splash.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  222.   ' Now load a bunch of forms.
  223.   Dim foo1 As New frmImages
  224.   Splash.rctStatusBar.Width = iStatusBarWidth * .25
  225.   Splash.Refresh
  226.   foo1.Caption = "Foo1"
  227.   foo1.Left = 0
  228.   foo1.Top = 0
  229.           
  230.   Dim foo2 As New frmImages
  231.   Splash.rctStatusBar.Width = iStatusBarWidth * .5
  232.   Splash.Refresh
  233.   foo2.Caption = "Foo2"
  234.   foo2.Left = 200
  235.   foo2.Top = 100
  236.           
  237.   Dim foo3 As New frmImages
  238.   Splash.rctStatusBar.Width = iStatusBarWidth * .75
  239.   Splash.Refresh
  240.   foo3.Caption = "Foo3"
  241.   foo3.Left = 300
  242.   foo3.Top = 150
  243.           
  244.   Dim foo4 As New frmImages
  245.   Splash.rctStatusBar.Width = iStatusBarWidth
  246.   Splash.Refresh
  247.   foo4.Caption = "Foo4"
  248.   foo4.Left = 400
  249.   foo4.Top = 200
  250.   ' Turn off the top most window flag.
  251.   success% = SetWindowPos(Splash.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
  252.   Unload Splash
  253.   Screen.MousePointer = DEFAULT
  254.   Exit Sub
  255. SplashLoadErr:
  256.   success% = SetWindowPos(Splash.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
  257.   Unload Splash
  258.   Screen.MousePointer = DEFAULT
  259.   MsgBox Error$ & " - " & Str$(Err), MB_ICONEXCLAMATION, "Application Load Error"
  260.   Exit Sub
  261. End Sub
  262.